-- GENERATED SPELL FOR [Ethereal Sorcerer] --


function spell0_18313(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(15791,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18313', 598, 1)
end

function spell1_18313(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(22273,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18313', 620, 1)
end

function spell2_18313(pUnit, Event) --@Slow,n/a--
pUnit:FullCastSpellOnTarget(25603,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18313', 5000, 1)
end

function Sorts_18313(pUnit, Event)
local choix_sorts_18313 = math.random(0, 2)
if choix_sorts_18313 == 0 then
pUnit:RegisterEvent('spell0_18313', 1, 1)
end
if choix_sorts_18313 == 1 then
pUnit:RegisterEvent('spell1_18313', 1, 1)
end
if choix_sorts_18313 == 2 then
pUnit:RegisterEvent('spell2_18313', 1, 1)
end
end

function mob18313_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18313', math.random(1500, 3000), 1)
end

function mob18313_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18313_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18313_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18313, 1, 'mob18313_Action')
RegisterUnitEvent(18313, 2, 'mob18313_Leave')
RegisterUnitEvent(18313, 3, 'mob18313_Kill')
RegisterUnitEvent(18313, 4, 'mob18313_Die')
